<?php if (!defined('THINK_PATH')) exit();?><head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title>长乐美食城 - 账号登录</title>
    <link rel="stylesheet" type="text/css" href="/Public/assets/home/css/register.css"/>
</head>
<body class="zh_CN">
<div class="wrapper">
    <div class="wrap">
        <div class="layout">
            <div class="n-frame device-frame reg_frame" id="main_container">
                <div class="external_logo_area"><a class="milogo" href="javascript:void(0)"></a></div>
                <div class="title-item t_c">
                    <h4 class="title_big30">注册长乐美食城帐号</h4>
                </div>
                <form>
                    <div class="regbox">
                        <div class="phone_step1">
                            <h4 class="tit_normal">
                                用户昵称：
                            </h4>
                            <div class="listwraps select-regions">
                                <div class="inputbg">
                                    <label class="labelbox">
                                        <input type="text" id="username" data-type="PH" placeholder="请输入昵称">
                                    </label>
                                </div>
                            </div>
                            <!--<h4 class="tit_normal">-->
                                <!--上传头像：-->
                            <!--</h4>-->
                            <!--<div class="listwraps elect-regions">-->
                                <!--<div class="inputbg">-->
                                    <!--<label class="labelbox">-->
                                        <!--<input type="file" id="thumb">-->
                                    <!--</label>-->
                                <!--</div>-->
                            <!--</div>-->
                            <h4 class="tit_normal">
                                手机号码：
                            </h4>
                            <div class="listwraps elect-regions">
                                <div class="inputbg">
                                    <label class="labelbox">
                                        <input type="text" id="mobile" placeholder="请输入手机号码">
                                    </label>
                                </div>
                            </div>
                            <h4 class="tit_normal">
                                性别：
                            </h4>
                            <div class="listwraps elect-regions">
                                <div class="inputbg">
                                    <label class="labelbox">
                                        <input type="text" id="sex" placeholder="请输入性别: 1代表男；0代表女">
                                    </label>
                                </div>
                            </div>
                            <h4 class="tit_normal">
                                生日：
                            </h4>
                            <div class="listwraps elect-regions">
                                <div class="inputbg">
                                    <label class="labelbox">
                                        <input type="text" id="birthday" placeholder="请输入生日">
                                    </label>
                                </div>
                            </div>
                            <h4 class="tit_normal">
                                邮箱：
                            </h4>
                            <div class="listwraps elect-regions">
                                <div class="inputbg">
                                    <label class="labelbox">
                                        <input type="email" id="email" placeholder="请输入邮箱">
                                    </label>
                                </div>
                            </div>
                            <h4 class="tit_normal">
                                密码：
                            </h4>
                            <div class="listwraps elect-regions">
                                <div class="inputbg">
                                    <label class="labelbox">
                                        <input type="password" id="password" placeholder="请输入密码">
                                    </label>
                                </div>
                            </div>
                            <h4 class="tit_normal">
                                确认密码：
                            </h4>
                            <div class="listwraps elect-regions">
                                <div class="inputbg">
                                    <label class="labelbox">
                                        <input type="password" id="check_password" placeholder="请再次输入密码">
                                    </label>
                                </div>
                            </div>

                            <div class="fixed_bot mar_phone_dis1">
                                <input class="btn332 btn_reg_1 submit" data-to="phone-step2" type="submit"
                                       value="立即注册">
                                <p class="msg">
                                    注册帐号即表示您同意并愿意遵守长乐美食城 <a href="http://www.miui.com/res/doc/eula/cn.html"
                                                            class="inspect_link agreement_link" title="用户协议"
                                                            target="_blank">用户协议</a>和<a
                                        href="http://www.miui.com/res/doc/privacy/cn.html"
                                        class="inspect_link privacy_link" title=" 隐私政策 " target="_blank"> 隐私政策 </a>
                                </p>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="n-footer">
    <div class="nf-link-area clearfix">
        <ul class="lang-select-list">
            <li><a class="lang-select-li current" href="javascript:void(0)" data-lang="zh_CN">简体</a>|</li>
            <li><a class="lang-select-li" href="javascript:void(0)" data-lang="zh_TW">繁体</a>|</li>
            <li><a class="lang-select-li" href="javascript:void(0)" data-lang="en">English</a></li>
            |
            <li><a class="a_critical" href="https://static.account.xiaomi.com/html/faq/faqList.html"
                   target="_blank"><em></em>常见问题</a></li>
        </ul>
    </div>
    <p class="nf-intro">
        <span>武汉长乐未央网络科技有限公司版权所有<br>
            <img src="https://account.xiaomi.com/static/res/9204d06/account-static/respassport/acc-2014/img/ghs.png">
        </span>鄂公网安备1234567890011号-鄂ICP证666888号</span>
    </p>
</div>
<script type="text/javascript" src="/Public/assets/home/js/jquery.min.js"></script>
<script>
    $(function(){
        $(".submit").click(function(){
            //获取表单的值
            var info = {
                'username': $("#username").val(),
                'password': $("#password").val(),
                'check_password': $("#check_password").val(),
                'email': $("#email").val(),
                'mobile': $("#mobile").val(),
                'birthday': $("#birthday").val(),
            };
//               console.log(info);return false;
            if(info.username.length<6){
                alert('用户名长度不能小于6位');
                return false;
            }
            if(info.password.length < 6){
                alert('密码不能小于6位');
                return false;
            }
            if(info.password!==info.check_password){
                alert('两次密码输入不一致');
                return false;
            }
            var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
            if(!myreg.test(info.email)) {
                alert('请输入正确的E-Mail地址');
                return false;
            }
            var phoneNum = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
            if(!phoneNum.test(info.mobile)) {
                alert('请输入正确的手机号');
                return false;
            }
            $.post("<?php echo U('register');?>",info,function(data){
                if(data.status=1){
                    alert(data.msg);
                    location.href="<?php echo U('Customer/login');?>";
                }else{
                    alert(data.msg);
                }
            });
            return false;
        })
    })
</script>